package com.quectel.core.module.household.dto;

import com.quectel.core.module.household.dto.custom.CohabitantDto;
import com.quectel.core.module.village.dto.VillageDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author caolu
 * @email louis.cao@quectel.com
 * @date 2021-11-02 13:11:28
 */
@Data
@Schema
public class HouseholdDto implements Serializable {

    /**
     *
     */
    @Schema(description = "")
    private Long id;

    /**
     *
     */
    @Schema(description = "")
    private Long tenantId;

    /**
     *
     */
    @Schema(description = "")
    @NotNull
    private Long villageId;

    /**
     * 姓名
     */
    @Schema(description = "姓名")
    @NotEmpty
    @Length(min = 1, max = 50)
    private String name;

    /**
     * 手机号
     */
    @Schema(description = "手机号")
    @Length(max = 20)
    private String mobile;

    /**
     * 性别1男0女
     */
    @Schema(description = "性别1男0女")
    private Byte gender;

    /**
     * 民族
     */
    @Schema(description = "民族")
    private String nation;

    /**
     * 人脸照片
     */
    @Schema(description = "人脸照片")
    private String faceImg;

    /**
     * 住户类型1业主2租客
     */
    @Schema(description = "住户类型1长住 2流动")
    private Byte type;

    /**
     * 是否户籍人口 1是0否
     */
    @Schema(description = "是否户籍人口 1是0否")
    private Byte populationType;

    /**
     * 职业状态 0待业 1就职 2退休
     */
    @Schema(description = "职业状态 0待业 1就职 2退休")
    private Byte jobStatus;

    /**
     * 标签 流动…
     */
    @Schema(description = "标签 流动…")
    private String label;

    /**
     * 标签 流动…
     */
    @Schema(description = "标签 流动…")
    private String tags;

    /**
     * 管控等级
     */
    @Schema(description = "管控等级")
    private Byte controlLevel;

    /**
     * 证件类型1身份证2护照3…
     */
    @Schema(description = "证件类型1身份证2护照3…")
    private Byte cardType;

    /**
     *
     */
    @Schema(description = "")
    private String cardNo;

    /**
     * 证件照片
     */
    @Schema(description = "证件照片")
    private String cardImg;

    /**
     *
     */
    @Schema(description = "")
    private String extraAttr;

    /**
     * 是否在家 0未知 1是 2否
     */
    @Schema(description = "是否在家 0未知 1是 2否")
    private Byte isAtHome;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;

    /**
     *
     */
    @Schema(description = "")
    private String creator;

    /**
     *
     */
    @Schema(description = "")
    private Date createTime;

    /**
     *
     */
    @Schema(description = "")
    private String editor;

    @AllArgsConstructor
    public enum TypeEnum {

        PERMANENT((byte) 1),
        FLOW((byte) 2);

        @Getter
        private Byte type;

    }

    @AllArgsConstructor
    public enum CardTypeEnum {

        ID_CARD((byte) 1),
        PASSPORT((byte) 2);

        @Getter
        private Byte cardType;

    }

    /**
     *
     */
    @Schema(description = "")
    private Date editTime;

    /************非数据库字段 start ************/
    @Schema(description = "小区信息")
    private VillageDto villageDto;

    @Schema(description = "住户和房屋的关系")
    private List<HouseholdRoomDto> householdRoomDtoList;

    @Schema(description = "家庭成员")
    private List<HouseholdFamilyDto> householdFamilyList;

    @Schema(description = "社会关系")
    private List<HouseholdSocialRelationsDto> socialRelationsList;

    @Schema(description = "同住人信息")
    private List<CohabitantDto> cohabitants;

    /************非数据库字段 end **************/
}
